home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Think Class Libraries / Expander / Expander Classes / CExpanderList.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-30  |  2.0 KB  |  70 lines  |  [TEXT/KAHL]

  1. /***********************************************************************************
  2.     CExpanderList.h
  3.  
  4.     Copyright © 1994 B-Ray Software. All rights reserved.
  5.     Developed using Symantec C++ 7.0.2 and Symantec's TCL library.
  6.     Portions of this code courtesy Symantec, Inc.
  7.  
  8.     This code may be freely distributed as long as this notice remains. This code
  9.     may not be used in any commercial software without the consent of B-Ray Software.
  10.  
  11.     ---
  12.  
  13.     Header file for CExpanderList class.
  14.  
  15. ***********************************************************************************/
  16. #pragma once
  17.  
  18. #include "CExpander.h"
  19.  
  20. class CExpanderList : public CExpander {
  21.  
  22. private:
  23.     long            selectedIndex;
  24.  
  25. protected:
  26.     virtual void    SelectChild( CFamily *aChild );
  27.     virtual void    ChildMessage( CFamily *aChild, long message, void *param );
  28.     virtual void    ParentMessage( long message, void *param );
  29.  
  30. public:
  31.  
  32.     TCL_DECLARE_CLASS
  33.  
  34.     CExpanderList();
  35.     CExpanderList( CView *anEnclosure, CBureaucrat *aSupervisor,
  36.                    short aWidth = 0, short aHeight = 0, short aHLoc = 0, short aVLoc = 0,
  37.                    SizingOption aHSizing = sizFIXEDSTICKY, SizingOption aVSizing = sizFIXEDSTICKY );
  38.     virtual ~CExpanderList();
  39.  
  40.     /*
  41.      * Access methods
  42.      */
  43.     virtual void    SetSelectedIndex( long index );
  44.     virtual long    GetSelectedIndex( void )
  45.                          { return selectedIndex; };
  46.  
  47.     virtual void    SetExpandedState( Boolean fState );
  48.  
  49.     virtual CFamily    *PrevChild( long index )
  50.                         { return IsExpanded() ? CExpander::PrevChild( index ) : NULL; };
  51.     virtual CFamily    *NextChild( long index )
  52.                         { return IsExpanded() ? CExpander::NextChild( index ) : NULL; };
  53.     virtual CFamily    *LastChild( void )
  54.                         { return IsExpanded() ? CExpander::LastChild() : FirstChild(); };
  55.  
  56.     /*
  57.      * Event methods
  58.      */
  59.     virtual void    DoKeyDown( char theChar, Byte keyCode, EventRecord *macEvent );
  60.     virtual void    DoAutoKey( char theChar, Byte keyCode, EventRecord *macEvent )
  61.                         { DoKeyDown( theChar, keyCode, macEvent ); };
  62.  
  63.     /*
  64.      * Stream methods
  65.      */
  66.     virtual void    PutTo( CStream &stream );
  67.     virtual void    GetFrom( CStream &stream );
  68. };
  69.  
  70.